#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    double currNum = 0;
    vector<double> nums;
    while (currNum >= 0) {
        cin >> currNum;
        if (currNum == 0) {
            sort(nums.begin(), nums.end());
            for (double num : nums) { printf("%.0lf ", num); }
            printf("%.6lf\n", nums.size() & 1 ? (double)nums[nums.size() / 2] :
            ((double)nums[nums.size() / 2] + (double)nums[nums.size() / 2 - 1]) / 2);
        }
        else if (currNum > 0) {
            nums.push_back(currNum);
        }
    }
    return 0;
}